UTF-8 with C++ in a Portable Way

This version is forked to work with ledger 3+
